<?php

class DBLine{
	var $table ;
	var $limit ;
	var $entity ;

	function DBLine($table,$limit,$initFromDB){
		$this->table = $table ;
		$this->limit = $limit ;

		if($initFromDB){
			
		}
	}

	function getAttrInt($name){
		$value = $this->attrs[$name];
		return intval($value) ;
	}


	function initFromDB(){
		$sqlstr = "select * from $table where $limit";
		$result = get_result($sqlstr) ;

		if(mysql_num_rows($result) > 0) {
			
			$i = 0;
			while ($i < mysql_num_fields($result)){
				$meta = mysql_fetch_field($result);
				array_push($this->columns,$meta->name) ;	
				// print($meta->name);
				$i++;
			}

			while($rows = mysql_fetch_array($result)){
				$matrix[$index] = $rows;
				$index++;
			}
		}

		
		for($i=0;$i<count($result);$i++){
			
		}
	}
	
}

?>